﻿using System;
using System.Windows;
using System.Windows.Input;

namespace MT.CustomWindow
{
    /// <summary>
    /// QrCodeWindow.xaml 的交互逻辑
    /// </summary>
    public partial class QrCodeWindow : Window
    {
        public static Action<bool> WindowShowAction;

        public string QrCode = string.Empty;

        public QrCodeWindow()
        {
            InitializeComponent();
            Text_QRCode.Focus();
        }

        private void Btn_Close_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }

        private void Text_QRCode_Name_PreviewKeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Return)
            {
                QrCode = Text_QRCode.Text;
                e.Handled = true;
                this.DialogResult = true;
                this.Close();
            }
        }
    }
}
